low, high = map(int, input().split())
cakes = list(map(int, input().split()))

dp = [0] * (high + 1)
dp[0] = 1

for c in cakes:
    for i in range(c, high + 1):
        dp[i] += dp[i - c]

print(sum(dp[low:high+1]))